package com.divineryang.service.impl;

import com.divineryang.mapper.BrandMapper;
import com.divineryang.service.BrandService;
import org.divineryang.model.entity.product.Brand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Diviner Yang
 * @version V1.0
 * @Package com.divineryang.service.impl
 * @date 2024/5/4 19:09
 */
@Service
public class BrandServiceImpl implements BrandService {

    @Autowired
    private BrandMapper brandMapper;

    @Cacheable(value = "brandList", unless="#result.size() == 0")
    @Override
    public List<Brand> findAll() {
        return brandMapper.findAll();
    }
}
